﻿<!--#include file="const.inc"-->
<%
'====================================================================
' 感谢使用晴天3G智能建站系统..
' 作者:梁永强.QQ:766750857
' 官方网址:wap.qt3g.com
' 声明:软件版权归作者所有,没有经过作者本人同意不得非法破解和传播本程序
'====================================================================
%>
<%
dim urls,id,page,content,pid,ton,tonn,face,qct,aid,rs,sql,i,bbd,nonn
        urls=Request.QueryString("urls")
        if urls="" then urls="index.asp"
        aid=qingtian.nid
		if sid<>"Null" then
                Page = Request("Page")      '当前页数
    		If Page = "" Then Page = 1
   		If Not IsNumeric(Page) Then Page = 1
    		Page = CLng(Page)
                If Page < 1 Then Page = 1
                id=Request.form("nid")
	        if id="" then id=aid
	        if not isnumeric(id) then id=aid
	        id=clng(id)
                if id<>aid and aid<>0 then ton="对"&qingtian.name(id)&"说:"             
                if id=0 then ton="对大家说:"              
                pid=Request.QueryString("pid")
	        if pid="" then pid=0
	        if not isnumeric(pid) then pid=0
	        pid=clng(pid)
                face=trim(Request.form("face"))
                if face="" then face=0
	        if not isnumeric(face) then face=0
	        face=clng(face)
                content=qingtian.repsql(Request.form("content"))
                qct=Request.QueryString("qct")
                tonn=Split("兄弟们[wenhao]|大家好,我来了|帅哥美女们,我来了|各位好","|") 
                Randomize()
                bbd=int(rnd*3)              
                if qct=1 then ton=tonn(bbd)
                if face<>0 then ton=ton&"[IMG]../IMG/"&face&".gif[/IMG]"
                content=ton&content
                if content<>"" then
                if session("addtime")="" or DATEDIFF("s", session("addtime"), now()) >10 then
                Set Rs = Server.CreateObject("Adodb.Recordset")
                Sql = "select * from [qingtian_yyy]"
		Rs.Open Sql,conn,1,3          
                rs.addnew
                rs("nid")=aid
                rs("name")=qingtian.name(aid)
                rs("content")=content
                rs("pid")=pid
	        rs.update
		Rs.close
		set rs=nothing
		session("addtime")=now
                if Request.QueryString("tsd")=1 then Response.Redirect Replace(qingtian.backurl(urls),"&amp;","&")
                else
                nonn="你的发言过快哦<br/>"
                end if
                end if
                set rs=Server.CreateObject("Adodb.Recordset")
		rs.open "select * from qingtian_yyy where DATEDIFF(""s"", time, now()) > 10*60",conn,1,3
		if not (rs.bof and rs.eof) then
                for i=1 to rs.RecordCount
		rs.delete
	 	Rs.MoveNext
	  	Next
		end if
		Rs.close
		set rs=nothing

select case v
case "0"
we0="<br/>"
hr="------------<br/>"
book="跳到第<input name='Page' format='*N' size='2' maxlength='5'/><anchor>页<go href='liuyyy.Asp?pid="&pid&"&amp;sid="&sidd&"&amp;urls="&urls&"' method='post'><postfield name=""Page"" value=""$(Page:n)"" /></go></anchor><br/>"

%>
<card title="页面聊天"><p align="<%=qingtian.px%>">
<%
case "1"
hr=""
zi="<span style=""color:#FF5500"">"
zi0="</span>"
we="<div class=""footer"">"
sou="<div class=""block4"">"
dao="<div class=""navi"">"
we0="</div>"
we1="</div>"
book="<form action=""liuyyy.Asp?pid="&pid&"&amp;sid="&sidd&"&amp;urls="&urls&""" method=""post"">跳到第<input type=""text"" name=""Page"" value="""" format=""*N"" size=""2"" maxlength=""5""/><input type=""submit"" value=""页"" /></form><br/>"

%>
<title>页面聊天</title>
</head>
<body>
<!--#include virtual="/css.inc"-->
<%

End Select

%>		
<%=qingtian.qingsav("850")%>
<%=dao%><a href="liuyyy.Asp?pid=<%=pid%>&amp;urls=<%=urls%>&amp;sid=<%=sidd%>">刷新</a>.<a href="liuyyyt.Asp?pid=<%=pid%>&amp;urls=<%=urls%>&amp;sid=<%=sidd%>">发言</a>.<a href="liuyyy.Asp?qct=1&amp;pid=<%=pid%>&amp;urls=<%=urls%>&amp;sid=<%=sidd%>">问好</a>.<a href="<%=qingtian.backurl(urls)%>">返回</a><%=we0%>
<%if v=0 then %>
	<input emptyok="true"  type="text" name="content<%=RndTXT%>" value="<%=tonn(bbd)%>" size="15"/><br/><select title='表情' name='face' value='0'><option title='表情' value='0'>表情</option><option title='微笑' value='1'>微笑</option><option title='哭泣' value='2'>哭泣</option><option title='调皮' value='3'>调皮</option><option title='脸红' value='4'>脸红</option><option title='害羞' value='5'>害羞</option><option title='生气' value='6'>生气</option><option title='偷笑' value='7'>偷笑</option><option title='流汗' value='8'>流汗</option><option title='我倒' value='9'>我倒</option><option title='得意' value='10'>得意</option><option title='奸笑' value='11'>奸笑</option><option title='疑问' value='12'>疑问</option><option title='睡觉' value='13'>睡觉</option><option title='好色' value='14'>好色</option><option title='口水' value='15'>口水</option><option title='敲头' value='16'>敲头</option><option title='惊讶' value='17'>惊讶</option><option title='撇嘴' value='18'>撇嘴</option><option title='难过' value='19'>难过</option><option title='玫瑰' value='20'>玫瑰</option></select>
	<anchor>发言
    	<go href="liuyyy.Asp?pid=<%=pid%>&amp;urls=<%=urls%>&amp;sid=<%=sidd%>" method='post'>
        <postfield name="content" value="$(content<%=RndTXT%>)"/>
        <postfield name="face" value="$(face)"/>
    	</go>
	</anchor><br/>
<%else%>
<form action="liuyyy.Asp?pid=<%=pid%>&amp;urls=<%=urls%>&amp;sid=<%=sidd%>" method="post"><%=we%>
<textarea name="content" rows="2"/><%=tonn(int(bbd))%></textarea><%=we0%><select title='表情' name='face' value='0'><option title='表情' value='0'>表情</option><option title='微笑' value='1'>微笑</option><option title='哭泣' value='2'>哭泣</option><option title='调皮' value='3'>调皮</option><option title='脸红' value='4'>脸红</option><option title='害羞' value='5'>害羞</option><option title='生气' value='6'>生气</option><option title='偷笑' value='7'>偷笑</option><option title='流汗' value='8'>流汗</option><option title='我倒' value='9'>我倒</option><option title='得意' value='10'>得意</option><option title='奸笑' value='11'>奸笑</option><option title='疑问' value='12'>疑问</option><option title='睡觉' value='13'>睡觉</option><option title='好色' value='14'>好色</option><option title='口水' value='15'>口水</option><option title='敲头' value='16'>敲头</option><option title='惊讶' value='17'>惊讶</option><option title='撇嘴' value='18'>撇嘴</option><option title='难过' value='19'>难过</option><option title='玫瑰' value='20'>玫瑰</option></select>
<input type="submit" value="发言"/>
</form><br/>
<%end if%>
<%=hr%><%=nonn%>
<%
Set Rs = Server.CreateObject("Adodb.Recordset")
Sql = "select * from [qingtian_yyy] where pid="&pid&" order by [id] desc"
		Rs.Open Sql,conn,1,1
		if not (rs.bof and rs.eof) then
				Rs.PageSize = 10	'一页N条记录
				IF Not IsEmpty(Page) Then
					IF Not IsNumeric(Page) Then		'判断Page是否为数字
						Page=1
					Else
						Page=Cint(Page)		'转换成短整形Integer
					End IF
					IF Page > Rs.PageCount Then
						Rs.AbsolutePage = Rs.PageCount	'设置当前显示页等于最后一页
					ElseIF Page <= 0 Then
						Rs.AbsolutePage = 1		'设置当前页等于第一页
					Else
						Rs.AbsolutePage = Page	'如果大于零,显示当前页等于接收的页数
					End IF
				Else
					Rs.AbsolutePage = 1
				End IF
				Page = Rs.AbsolutePage

        	For i=1 to  Rs.PageSize
		If Rs.Eof Then
			exit For
		End If
dat=i         
dat1=dat mod 2
if dat1=0 then
%>			
<%=we%><a href="/user/liaoinfo.Asp?id=<%=rs("nid")%>&amp;urls=<%=urls%>&amp;sid=<%=sidd%>"><%=qingtian.utf8(rs("name"))%></a>:<%=qingtian.ubb(rs("content"))%>(<%=qingtian.datatime(now,rs("time"))%>)<%=we0%>
<%
else
%>
<%=sou%><a href="/user/liaoinfo.Asp?id=<%=rs("nid")%>&amp;urls=<%=urls%>&amp;sid=<%=sidd%>"><%=qingtian.utf8(rs("name"))%></a>:<%=qingtian.ubb(rs("content"))%>(<%=qingtian.datatime(now,rs("time"))%>)<%=we0%>
<%
End If
			
	 	Rs.MoveNext
	  	Next

           	If rs.PageCount > 1 Then
    		    %>
		<%=dao%>
		<%
    		End If
   		'分页
    		If Page < rs.PageCount Then
    		    Response.Write("<a href='liuyyy.Asp?pid="&pid&"&amp;sid="&sidd&"&amp;urls="&urls&"&amp;page=" & Page + 1 & "'>下一页</a>")
    		End If
       
    		If Page > 1 And Page < rs.PageCount Then
    		    Response.Write("|")
    		End If
        
    		If Page > 1 Then
    		    Response.Write("<a href='liuyyy.Asp?pid="&pid&"&amp;sid="&sidd&"&amp;urls="&urls&"&amp;page=" & Page - 1 & "'>上一页</a>"&we0&"")
    		Elseif rs.PageCount >1 then
    		    Response.Write we0
    		End If
            
    		Randomize()
    
    		If rs.PageCount > 2 Then
    		    %>
		<%=book%>
		<%
                 Response.Write("" & we & "[第"&Page&"/总"&rs.PageCount&"页/"&rs.RecordCount&"条]"&we0&"")
    		End If
		else
		response.write(""&we&"暂无人发言"&we0&"")
		end if
		Rs.close

	set rs=nothing
%>
<%=qingtian.qingsav("851")%>
<%=hr%>
<%=dao%><a href="<%=qingtian.backurl(urls)%>">返回来源页</a><%=we0%>                  
<%
else
Response.Redirect "/login.asp?sid=" & sidd & "&url="&urls
end if

end Function
%>
